package com.rohan.apps.mileagetracker.client;



import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.ui.RootPanel;

import com.rohan.apps.mileagetracker.client.ui.WiringTest;
import com.rohan.apps.mileagetracker.shared.service.MileageTrackerRequestFactory;



/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class MileageTracker implements EntryPoint {

	
	
	final EventBus eventBus = new SimpleEventBus();
	final MileageTrackerRequestFactory requestFactory = GWT.create(MileageTrackerRequestFactory.class);
    String sessionID;
	@Override
	public void onModuleLoad() {
		// TODO Auto-generated method stub
		requestFactory.initialize(eventBus);
		
		WiringTest wt= new WiringTest(requestFactory);
		RootPanel.get("divApp").add(wt);
		
		//Check for log in cookie
//		if(Cookies.getCookie("user_token")!=null && Cookies.getCookie("user_token")!=""){
//			//cookie exists
//			checkWithServerIfTokenIsGood(Cookies.getCookie("user_token"));
//		}
//		else
//		{
//		  //RootPanel.get("").setVisible(true);
//		}
		
		
		
	}
	
}
